import { globalComponents } from './core/starter'

/**
 * 对外暴露全局组件注册接口
 */
export const globalComponent = {
  /**
   * 设置 BasicLayout 登录用户展示栏组件
   * @param {*} component
   */
  setUserInfoHeader (component) {
    globalComponents.UserInfoHeader = component
  },
  /**
   * 设置全局 PageCard 组件
   * @param {*} component
   */
  setPageCard (component) {
    globalComponents.PageCard = component
  },
  /**
   * 设置 BasicLayout 顶部工具栏
   * @param {*} component
   */
  setHeaderToolbar (component) {
    globalComponents.HeaderToolbar = component
  },
  /**
   * 设置 BasicLayout 顶部用户工具栏
   * @param {*} component
   */
  setUserHeaderToolbar (component) {
    globalComponents.UserHeaderToolbar = component
  },
  /**
   * BasicLayout 菜单头部组件
   * @param {*} component
   */
  setMenuHeader (component) {
    globalComponents.MenuHeader = component
  },
  /**
   * 默认多标签组件
   * @param {*} component
   */
  setDefaultMultiTab (component) {
    globalComponents.defaultMultiTab = component
  },
  /**
   * 总是在新标签中打开的组件
   */
  setAlwaysMultiTab (component) {
    globalComponents.alwaysMultiTab = component
  },
  /**
   * 个性化设置组件
   * @param {*} component
   */
  setThemesSetting (component) {
    globalComponents.themesSetting = component
  }
}